/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author stumbledog
 */
@Entity
@Table(name = "fantasygameresult")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fantasygameresult.findAll", query = "SELECT f FROM Fantasygameresult f"),
    @NamedQuery(name = "Fantasygameresult.findById", query = "SELECT f FROM Fantasygameresult f WHERE f.id = :id"),
    @NamedQuery(name = "Fantasygameresult.findByWin", query = "SELECT f FROM Fantasygameresult f WHERE f.win = :win"),
    @NamedQuery(name = "Fantasygameresult.findByLose", query = "SELECT f FROM Fantasygameresult f WHERE f.lose = :lose"),
    @NamedQuery(name = "Fantasygameresult.findByWithdraw", query = "SELECT f FROM Fantasygameresult f WHERE f.withdraw = :withdraw")})
public class Fantasygameresult implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "win")
    private Integer win;
    @Column(name = "lose")
    private Integer lose;
    @Column(name = "withdraw")
    private Integer withdraw;
    @JoinColumn(name = "weekId", referencedColumnName = "id")
    @ManyToOne
    private Week weekId;
    @JoinColumn(name = "teamId", referencedColumnName = "id")
    @ManyToOne
    private Fantasyteam teamId;

    public Fantasygameresult() {
    }

    public Fantasygameresult(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getWin() {
        return win;
    }

    public void setWin(Integer win) {
        this.win = win;
    }

    public Integer getLose() {
        return lose;
    }

    public void setLose(Integer lose) {
        this.lose = lose;
    }

    public Integer getWithdraw() {
        return withdraw;
    }

    public void setWithdraw(Integer withdraw) {
        this.withdraw = withdraw;
    }

    public Week getWeekId() {
        return weekId;
    }

    public void setWeekId(Week weekId) {
        this.weekId = weekId;
    }

    public Fantasyteam getTeamId() {
        return teamId;
    }

    public void setTeamId(Fantasyteam teamId) {
        this.teamId = teamId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fantasygameresult)) {
            return false;
        }
        Fantasygameresult other = (Fantasygameresult) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Fantasygameresult[ id=" + id + " ]";
    }
    
}
